home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
earkit
/
news
/
thor
/
hd-install
/
unix
/
grab.oslonett
< prev
Wrap
Text File
|
1997-08-25
|
3KB
|
90 lines
#!/bin/sh
# $Id: grab.oslonett 1.1 1996/07/18 04:12:16 pettern Exp $
##########################################################################
# UQWK_SOUP grab script v0.95 for THOR. Author: Kjell Irgens. #
# Should be safe to use, but I take *no* responsibilities for lost mail. #
# grab -h for help. #
# This version will export the active file, for non-standard setups. #
##########################################################################
grab=soup # modify if the grab in THOR name is not "soup"
wdir=soup # name of work directory (UN*X side)
UQ_HOME_DIR=. UQ_DO_NEWS=1 UQ_SOUP_MODE=1 UQ_NRC_FILE=$HOME/.newsrc UQ_ACT_FILE="/local/news/active"
export UQ_HOME_DIR UQ_DO_NEWS UQ_SOUP_MODE UQ_NRC_FILE UQ_ACT_FILE
repliesfile=$grab\.out
grabfile=$grab`date +%H%M%S`.zip
mkdir 2>/dev/null $HOME/$wdir
cd $HOME/$wdir
no_rz=false no_sz=false restore=false UQ_DO_MAIL=1
for i in $*
do
case $i in
-r ) no_rz=true ;;
-s ) no_sz=true ;;
-n ) UQ_DO_NEWS=0 ; export UQ_DO_NEWS ;;
-m ) UQ_DO_MAIL=0 ; export UQ_DO_MAIL ;;
-u ) UQ_MAX_BLKS=0 ; export UQ_MAX_BLKS;;
-x ) if [ -r .mail_backup ]
then echo "Restoring mail..."
else echo "No mail to restore"
fi
cat 2>/dev/null .mail_backup >>$MAIL && rm 2>/dev/null .mail_backup
restore=true;;
-z ) if [ -r .newsrc_backup ]
then echo "Restoring news..."
else echo "No news to restore"
fi
mv 2>/dev/null .newsrc_backup $UQ_NRC_FILE
restore=true;;
* )
echo "Usage: $0 [option] ..."
echo "[-r] no rz";echo "[-s] no sz";echo "[-n] don't grab news"
echo "[-m] don't grab mail";echo "[-u] unlimited grab size"
echo "[-x] restore mail";echo "[-z] restore news"
echo "[-h] this text"
exit 0 ;;
esac
done
if [ $restore = true ]
then exit 0
fi
# backups never hurt anyone
if [ $UQ_DO_MAIL = 1 ]
then cp 2>/dev/null $MAIL .mail_backup
fi
if [ $UQ_DO_NEWS = 1 ]
then cp 2>/dev/null $UQ_NRC_FILE .newsrc_backup
fi
if [ $no_rz = false ]
then rz
fi
if [ -r $repliesfile ]
then unzip -U $repliesfile
fi
if [ -r REPLIES ]
then /local/bin/uqwk18.exe -RREPLIES
else /local/bin/uqwk18.exe
fi
rm 2>/dev/null $repliesfile
if [ -r AREAS ]
then
zip -m $grabfile AREAS *.MSG
if [ $no_sz = false ] # assumes you use zmodem, you could also
then # use: kermit -i -s $grabfile && ...
sz -br $grabfile && rm $grabfile
fi
fi